package com.bsj.travel.constants;

/**
 * @author yinhao
 * @version 1.0
 * @description redis缓存key
 * @date 2023/11/8
 */
public class RedisConstant {

    /**
     * 产品信息key hash结构，key固定，小key为产品key，value为产品列表详细信息
     */
    public static final String PRODUCT_INFO_KEY = "BSJ:PRODUCT:INFO:";
    /**
     * 产品自定义主题信息 hash结构，key + 产品key，小key为主题id value为主题详细信息
     */
    public static final String PRODUCT_CUSTOMIZE_TOPIC_KEY = "BSJ:PRODUCT:CUSTOMIZE:TOPIC:";
    /**
     * 基础不可删减主题信息 KEY固定，value为主题详细信息
     */
    public static final String PRODUCT_BASE_TOPIC_KEY = "BSJ:BASE:TOPIC";

    /**
     * 设备信息key hash结构，key为 + 产品KEY, 小key为设备号，value为设备具体信息
     */
    public static final String PRODUCT_DEVICE_INFO_KEY = "BSJ:PRODUCT:DEVICE:";
    /**
     * 按照每分钟统计出设备在线数
     */
    public static final String CLIENT_CONNECT_SUM_KEY = "BSJ:CLIENT:SUM:";
    /**
     * OTA升级包信息key hash结构，key为+产品KEY，小key为升级包id，value为OTA升级包信息
     */
    public static final String PRODUCT_OTA_INFO_KEY = "BSJ:PRODUCT:OTA:";
    /**
     * 订阅信息key string结构，key为+产品ID，value为订阅信息
     */
    public static final String PRODUCT_SUBSCRIBE_INFO_KEY = "BSJ:PRODUCT:SUBSCRIBE:";
    /**
     * mqtt 服务端节点key
     */
    public static final String SERVER_NODES = "mqtt:server:nodes:";
    /**
     * 连接状态存储
     */
    public static final String CONNECT_STATUS = "mqtt:connect:status:";
    /**
     * 设备连接所在节点存储
     */
    public static final String CONNECT_NODE = "mqtt:connect:node:";
    /**
     * mqtt 集群上线同设备唯一性
     */
    public static final String LINE_PUB_SUB_TOPIC = "mqtt:pub:topic:line:";
    /**
     * 最后在线时间 String类型 key+设备号 value为时间戳
     */
    public static final String LAST_ONLINE_TIME = "BSJ:DEVICE:LAST:ONLINE:TIME:";
}
